package org.example.datetime;

import com.google.common.base.Strings;

import java.time.LocalDate;
import java.time.temporal.IsoFields;
import java.time.temporal.WeekFields;

public class WeekTest {

    public static void main(String[] args) {
        LocalDate ld = LocalDate.now();
        int weekNumber = ld.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR);
        System.out.println(Strings.lenientFormat("Week number = %s", weekNumber));
        weekNumber = ld.get(WeekFields.ISO.weekOfWeekBasedYear());
        System.out.println(Strings.lenientFormat("Week number = %s", weekNumber));
    }
}
